package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserMapper {

//	@Select("select * from user where name = #{name}")
	User findByName(String name);

//	@Select("select * from user where id = #{id}")
	User findById(Integer id);

	@Options(useGeneratedKeys = true,keyProperty = "id")
	@Insert("insert into user(name,password,perms) value(#{name},#{password},#{perms} )")
	Integer add(User user);
}
